A vehicle includes an electronic control unit (ECU) for, for example, controlling components such as an engine. The electronic control unit controls components such as an engine by executing firmware. In recent years, vehicles capable of connecting to networks have been proposed. The electronic control unit provided in such a vehicle can download data via a network to update firmware. When vulnerability is found in the firmware, the electronic control unit can update the firmware without returning the vehicle to a factory or the like.
Conventionally, when firmware update has failed, an electronic control unit needs downloading a current version of firmware and writing it into a memory. For this reason, an electronic control unit needs accessing a server or the like again when the firmware update has failed, and it takes a long period between when the update has been started and when the firmware becomes executable.
In some cases, to solve such an inconvenience, an electronic control unit includes two buffers, which temporarily store data. When updating firmware, the thus configured electronic control unit causes one of the buffers to retain a current version of the firmware and downloads a new version of the firmware using the other buffer. When the firmware update has failed, the electronic control unit writes, back into the memory, the current version of the firmware stored in one of the buffers. However, the need to include two buffers makes the cost for the thus configured electronic control unit high. In addition, a vehicle that includes a plurality of electronic control units needs to include two buffers for each of the electronic control units, which increases the cost of the entire vehicle.